/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tabelamodelcolumnmodel.servico.orcamento;

import tabelamodelcolumnmodel.servico.*;
import eloma.classe.Cliente;
import eloma.classe.servico.Servico;
import eloma.classe.servico.orcamento.ServicoOrcamento;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Icaro
 */
public class ServicoOrcamentoTableModel extends AbstractTableModel {

    private List<ServicoOrcamento> listServico;
    private boolean ordenarPorNome = true;

    public ServicoOrcamentoTableModel(List<ServicoOrcamento> listServico) {
        this.listServico = listServico;
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        ServicoOrcamento servico = listServico.get(rowIndex);
        switch (columnIndex) {
            case 0:
                return 1;

        }

        return null;
    }

    @Override
    public int getRowCount() {
        return listServico.size();
    }

    @Override
    public int getColumnCount() {
        return 2;
    }

    public ServicoOrcamento getValoresServico(int rowIndex) {
        return listServico.get(rowIndex);
    }

    public boolean isOrdenarPorNome() {
        return ordenarPorNome;
    }

    public void setOrdenarPorNome(boolean ordenarPorNome) {
        this.ordenarPorNome = ordenarPorNome;
    }

}
